package clinivida.converter;

import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;

import clinivida.entity.Pais;

public class PaisConversor implements Converter
{

    public Object getAsObject(FacesContext arg0, UIComponent arg1, String arg2)
    {

        Pais pais = new Pais();
        if(arg2 != null && !arg2.equals(""))
        {
            pais.setCodPais(Integer.parseInt(arg2));
        }
        return pais;
    }

    public String getAsString(FacesContext arg0, UIComponent arg1, Object arg2)
    {
        return (String) arg2.toString();
    }

}
